import httpInstant from '../utils/http';


/**
 * @description 获取历史记录列表
 * @param userId 用户id
 * @param time 时间 近七天 还是 今天
 * @returns
 */
export function getHistoryListApi(userId, time) {
  return httpInstant.get(`/history/getHistoryList`, {
    params: {
      userId,
      time
    }
  });
}




export function switchCollectionApi(postId, userId, isCollection) {
  return httpInstant.put(`/history/switchCollection`, {
    postId,
    userId,
    is: isCollection
  });
}


/**
 * @description 搜索历史记录
 * @param userId 用户id
 * @param keyword 关键字
 * @returns
 */
export function searchHistoryApi(userId, keyword) {
  return httpInstant.get(`/history/searchHistory`, {
    params: {
      userId,
      keyword
    }
  });
}